﻿// Developer Express Code Central Example:
// How to create a GridView descendant class and register it for design-time use
// 
// This is an example of a custom GridView and a custom control that inherits the
// DevExpress.XtraGrid.GridControl. Make sure to build the project prior to opening
// Form1 in the designer. Please refer to the http://www.devexpress.com/scid=A859
// Knowledge Base article for the additional information.
// 
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E900

using System;
using System.Windows.Forms;
using DevExpress.XtraGrid.Views.Grid;

namespace VNPT.Control {
	public class MyGridHandler : DevExpress.XtraGrid.Views.Grid.Handler.GridHandler {
		public MyGridHandler(GridView gridView) : base(gridView) {}

		protected override void OnKeyDown(KeyEventArgs e) {
			base.OnKeyDown(e);
			if(e.KeyData == Keys.Delete && View.State == GridState.Normal)
				View.DeleteRow(View.FocusedRowHandle);
		}
	}
}
